$("#login-btn").click(function(){
	$.ajax({
	type:"post",
	url:"login",
	data:{
		account:$("#username").val(),
		password:$("#password").val()
	},
	success:function(result){
		if(result.resultParm.code=="200"){
			alert(result.resultInfo);
		} else if(result.resultParm.code=="100"){
			var role = result.resultParm.user.role;
			if(role==0){
				alert("你无权限访问系统管理后台!");
			}else if(role==3){
				alert(result.resultInfo);
				window.location.href="views/place-manager.html";
			}else if(role==1){
				alert(result.resultInfo);
				window.location.href="views/game-manager.html";
			}else if(role==2 ){
				alert(result.resultInfo);
				window.location.href="views/eq-manager.html";
			}else if(role==4){
				alert(result.resultInfo);
				window.location.href="views/personalAdmin.html";
			} 
		}
	},
	error:function(result){
		alert("登录失败");
	}
});
});
